package com.frameproject;



import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.intent.demo.Activity_A;

import androidx.appcompat.app.AppCompatActivity;


public class MainActivity extends AppCompatActivity {

    private  String TAG="Lifecycle";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.i(TAG,"第一个界面 ---> onCreate ~~~~~~");
        findViewById(R.id.go_to_page2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, Activity_A.class);
                startActivity(intent);
            }
        });
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.i(TAG,"第一个界面 ---> onStart ~~~~~~");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.i(TAG,"第一个界面 ---> onResume ~~~~~~");
    }


    @Override
    protected void onPause() {
        super.onPause();
        Log.i(TAG,"第一个界面 ---> onPause ~~~~~~");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.i(TAG,"第一个界面 ---> onStop ~~~~~~");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.i(TAG,"第一个界面 ---> onDestroy ~~~~~~");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.i(TAG,"第一个界面 ---> onRestart ~~~~~~");
    }
}


